<!DOCTYPE HTML>
<html>
<head>
<title>后台用户状态锁定</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script>
	$(function(){
		changeLoginFun();
		$("input:radio[name='state']").change(changeLoginFun);
	});
	
	function changeLoginFun(){ 
		var val = $("input:radio[name='state']:checked").val();
		if(val == 1) {//解锁
			$("#remark").attr("disabled",true);
		}else {
			$("#remark").attr("disabled",false);
		}
	}
	
</script>
</head>
<body>
	<div id="msg" style="color:red;"></div>
	<form role="form" id="userForm" data-th-action="@{/user/add}" data-th-object="${user}" data-th-method="post">
		<div class="box-body">
			<input type="hidden" data-th-field="*{id}" name="id"/>
			<input type="hidden" data-th-field="*{delFlag}" name="delFlag"/>
			<input type="hidden" data-th-field="*{username}" name="username"/>
			<input type="hidden" data-th-field="*{userpassword}" name="userpassword"/>
			<input type="hidden" data-th-field="*{nickname}" name="nickname"/>
			<input type="hidden" data-th-field="*{phone}" name="phone"/>
			<input type="hidden" data-th-value="${role.id}" name="role.id"/>
			<input type="hidden" data-th-value="*{salt}" name="salt"/>
			<input type="hidden" data-th-value="*{userKey}" name="userKey"/>
			<input type="hidden" data-th-value="*{sysPwd}" name="sysPwd"/>
			
			
            <div class="form-group">
              <label for="name" style="vertical-align:middle; margin-top:1px; margin-bottom:1px;">用户名：</label>
              <label data-th-text="*{username}" id="name" class="checkbox-inline"></label>
            </div>
            <div class="form-group">
			  <label for="loginStatus" style="vertical-align:middle; margin-top:1px; margin-bottom:1px;">登录锁定：</label>
			  <label class="checkbox-inline" id="loginStatus">
	              <input class="iradio_flat-green" style="vertical-align:middle; margin-top:-2px; margin-bottom:1px;" data-th-field="*{state}" type="radio" name="state" value="0" /> 锁定用户
			  </label>
			  <label class="checkbox-inline">
	              <input class="iradio_flat-green" style="vertical-align:middle; margin-top:-2px; margin-bottom:1px;" data-th-field="*{state}" type="radio" name="state" value="1" /> 解锁用户
			  </label>
            </div>
            <div class="form-group">
            	<label>原因：</label>
				<div class="row">
					<div class="col-md-10">
						<textarea name="remark" id="remark" rows="3"
							class="form-control" data-th-field="*{remark}"></textarea>
					</div>
				</div>
			</div>
        </div> 
	</form>
</body>
</html>